﻿using System;
using System.Collections.Generic;
using System.Text;
using EntLibEC.Cmn;

namespace EntLibEC.Info.Basic
{
    public class CustomizedCategoryInfo
    {
        private int sysNo;
        private int categoryType;
        private int parentSysNo;
        private int originCategorySysNo;
        private int status;
        private string categoryName;
        private string url;
        private int promotionStatus;
        private int priority;
        private string note;
        private int lastEditUserSysNo;
        private DateTime lastEditDate;
        private int isAutoExpand;

        public void Init()
        {
            sysNo = AppConst.IntNull;
            categoryType = AppConst.IntNull;
            parentSysNo = AppConst.IntNull;
            originCategorySysNo = AppConst.IntNull;
            status = 1;
            categoryName = string.Empty;
            url = string.Empty;
            promotionStatus = 0;
            priority = 0;
            note = string.Empty;
            lastEditUserSysNo = AppConst.IntNull;
            lastEditDate = DateTime.Now;
            isAutoExpand = 0;
        }


        #region public accessor 
        public int SysNo
        {
            get { return sysNo;}
            set { sysNo = value; }
        }

        public int CategoryType
        {
            get { return categoryType; }
            set { categoryType = value; }
        }

        public int ParentSysNo
        {
            get { return parentSysNo; }
            set { parentSysNo = value; }
        }

        public int OriginCategorySysNo
        {
            get { return originCategorySysNo; }
            set { originCategorySysNo = value; }
        }

        public int Status
        {
            get { return status; }
            set { status = value; }
        }

        public string CategoryName
        {
            get { return categoryName; }
            set { categoryName = value; }
        }

        public string URL
        {
            get { return url; }
            set { url = value; }
        }

        public int PromotionStatus
        {
            get { return promotionStatus; }
            set { promotionStatus = value; }
        }

        public int Priority
        {
            get { return priority; }
            set { priority = value; }
        }

        public string Note
        {
            get { return note; }
            set { note = value; }
        }

        public int LastEditUserSysNo
        {
            get { return lastEditUserSysNo; }
            set { lastEditUserSysNo = value; }
        }

        public DateTime LastEditDate
        {
            get { return lastEditDate; }
            set { lastEditDate = value; }
        }

        public int IsAutoExpand
        {
            get { return isAutoExpand; }
            set { isAutoExpand = value; }
        }
        #endregion

        public override string ToString()
        {
            string temp = this.categoryName + "[" + this.categoryType + "] ";
            if (this.status == -1) //appenum.bistatus.invalid
                temp += "(*)";
            return temp;
        }
    }
}
